//
//  BoundEmptyView.swift
//  EasePods
//
//  Created by 李然 on 2024/5/6.
//

import UIKit
import EarbudsCommon

class BoundEmptyView: View {
    
    override func makeUI() {
        super.makeUI()
        
        backgroundColor = R.color.common_2_bg_page()
        
        let containView = View()
        addSubview(containView)
        containView.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.centerY.equalToSuperview().offset(-30)
            make.width.equalToSuperview()
        }
        
        containView.addSubview(iconView)
        iconView.snp.makeConstraints { make in
            make.top.centerX.equalToSuperview()
        }
        
        containView.addSubview(tipLabel)
        tipLabel.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalTo(iconView.snp.bottom).offset(8)
        }
        
        containView.addSubview(retryBtn)
        retryBtn.snp.makeConstraints { make in
            make.centerX.bottom.equalToSuperview()
            make.top.equalTo(tipLabel.snp.bottom).offset(66)
            make.size.equalTo(CGSize(width: 154, height: 48))
        }
    }
    
    lazy var iconView: UIImageView = {
        let view = UIImageView()
        view.image = R.image.img_bound_nofind()
        return view
    }()
    
    lazy var tipLabel: UILabel = {
        let label = UILabel()
        label.textColor = R.color.common_3_text()
        label.font = Fonts.systemFont(ofSize: 14)
        label.numberOfLines = 0
        label.text = R.string.localizable.bound_not_found_device_tip()
        return label
    }()
    
    lazy var retryBtn: UIButton = {
        let btn = UIButton(type: .custom)
        btn.layer.cornerRadius = 6
        btn.backgroundColor = R.color.common_22_button_n()
        btn.setTitle(R.string.localizable.common_retry(), for: .normal)
        btn.titleLabel?.font = Fonts.systemFont(ofSize: 16,weight: .semibold)
        btn.setTitleColor(R.color.common_24_button_text(), for: .normal)
        return btn
    }()
    
}

